Class 3 Lab - Cartographic Principles + Thematic Mapping, Part I

Imgur

source: http://personal.tcu.edu/kylewalker/immigrant-america | Mapping Immigrant America


Concepts & Themes:

This week’s lab will feature exploration of the following:


Lab I - Field Calculator Review:

In this first lab, we will review the core components of the Field Calculator - an integral QGIS tool that we will revisit with frequency throughout the course. Familiarity now will increase your effectiveness later.

In the class 2 assignment, we utilized the Field Calculator to create new fields for geometry ($area) and a rate based on the $area field. In this review, we will create a new column for length of each railroad segment in kilometers.

Before proceeding, its important to understand how QGIS understands units for geometry calculations. By default, meters are utilized based on an ellisoid (curved surface) . We can check this QGIS > Project > Project Preferences > General > Measurements. In effect, the $length calculation will result in a value measured in meters.

  • To Start, we will utilize QGIS sample data, in this case the railroads.shp that represents railroad alignments in North America. Point to the data and import as a vector feature:

  • Navigate to the Open Field Calculator tool from the Toobar:

  • Populate the tool dialog box as follows, 1 - 6:

  • Create New Field - typically you will want to do this. You can also Update an Existing Field or Create Virtual Field - which creates a temporary field typically used for compound calculations.

  • Output Field Name - keep short and simple. Here its simply length + km for kilometer unit.

  • Output Field Type - determines the field type. Whenever calculating geometry, you will want a decimal number (real).

  • Output Field Length and Precision - defaults to 10/3 which will handle most scenarios Here a field width of 10 and a field precision of 3 means 6 digits before the dot, then the dot itself (1) and another 3 digits for the precision.

  • Selected Function Helper - choose the Geometry option, dropdown to $length and populate in 6 - Expression Editor.

  • Expression Editor - in order to produce the units in kilometers, divide $length by 1000 (meters/1000 = kilometers)

  • Check the attribute result. There should now be a field length_km populated with kilometers per railroad, i.e. the length of each railroad in the feature layer. If you produce a mistake, you can easily delete the error field and start over by click on the delete field icon in the attribute view, and then selecting which field to delete in the tool dialog box:

  • Toogle OFF Toogle Editing with a right-click on feature layer in the Layers Panel:


Lab II - Dot Density Mapping:

In this second lab, we will explore a thematic mapping technique that can be used effectively for categorical mapping at various scales. Here, ‘dots’ represents certain proportions of a quality across 1 or more type classes.

The theme of the mapping is Majority Population and Minority Populations for U.S. States, 2017. In the dataset, there are columns for each; and then columns for those populations divided by 10,000. This results in a variable that can be shown as ‘1 dot = 10,000 people’.

This technique is known as ‘dot density mapping’. These maps display dot density in a randomized distribution. Random points are used to create a dot density map within polygon features. Proportionality is integral to the dot density technique. Here 1 dot on the map will represent x number of variable occurrences. Exact location is sacrificed and replaced with generalized densities.

This technique is very effective when utilized with a categorical value across limited (smaller, 2 - 5 classes, typically).

  • To start, download the data, unzip to the working drive:

  • Download Class 3 Lab 2 Data

  • Inside the data folder find the following:

    • states.2017.shp
  • Next, import the states.2017.shp into a working QGIS project.

  • Symbolize states so that that they are a transparent fill with a simple label for the State field:

Note: its important to run dot density mapping within polygon features that are projected; that is, they are not in an unprojected coordinate system like WGS84. The reasoning here is that the points need to be distributed randomly based on distance within the polygons, and a projected coordinate system is important for this process. Currently states.2017.shp is indeed projected to North_America_Albers_Equal_Area_Conic.

  • Continue to the GIS processing for Random Points Inside Polygons:

  • Populate the tool so that the field that represents the minority population per state as divided by 10,000 is populated into the points count option (min.10k):

  • Run the tool, producing a temporary layer.

  • Again, Continue to the GIS processing for Random Points Inside Polygons. When populating the tool this second time, point points count option to maj.10k to represent the majority population per state divided by 10,000:

  • Adjust symbology so that the two layers are contrasting colors per class - Minority vs Majority. Optimize dot size to size 1 or 2 (depending on chosen map scale):

Note: is the map above, the Majority population is symbolized as dark green, and Minority population as magenta.

  • View the results. While the White Alone population in the U.S. is still the Majority population, its not by much, and will soon be replaced by the Minority population as indeed the majority. As such, many states seem to have very close dot counts per 10K persons. A marked exception is Puerto Rico with a significant Minority-majority population:

  • Notice that this type of mapping shows concentration as well as categorical type distinctions where states with high overall populations show dense dot density patterns. Depending of the scale of the mapping and the number of type classes, this type of thematic mapping can be very effective to show both concentration and type.

Lab III - Land Use Mapping with Definition Layers:

  • In this final lab, a typical categorical mapping challenge can be resolved effectively. In this particular situation, we have a feature layer of land use polygons. Each polygon represents a parcel boundary within a municipal boundary - in this case, parcels within New York City. Typically municipalities will deem a parcel to be of land use type. This land use is then mangaged over time by zoning regulations. In NYC, the following land use types are utilized, 1 - 11 per parcel:

source: https://zola.planning.nyc.gov/about/

Code Description Hex_Code
01 One & Two Family Buildings feff9e
02 Multi-Family Walk-Up Buildings fcaf3a
03 Multi-Family Elevator Buildings a86300
04 Mixed Residential & Commerical Buildings ff7839
05 Commercial & Office Buildings fc2525
06 Industrial & Manufacturing df57fa
07 Transportation & Utility dcb6e8
08 Public Facilities & Institutions 3c99cf
09 Open Space & Outdoor Recreation 6dcc66
10 Parking Facilities b1afad
11 Vacant Land 4b4b4b

source: https://www1.nyc.gov/assets/planning/download/pdf/data-maps/open-data/pluto_datadictionary.pdf?r=20v5

  • The problem comes into play when we want to map these parcels according to ‘official’ color schemes based on land use type. This is categorical mapping - each polygon is of a land use type; thus we need a different color for each type. Sometimes these colors can be available by the data provider for QGIS in what is known as a Style Layer. The file extention is .qml. You can make these .qml files by simply exporting them along with your feature exports:

  • To Begin this short lab, navigate to the assignment data and import the shapefile for the NYC land use parcel data into a QGIS project.

  • Inside the data folder find the following:

    • MapPLUTO.shp

  • **Next, note the location of the .qml file; its should reside near/within the project data folder:

  • The .qml file does not import in the Layers Panel; rather it is ‘attached’ within the .shp. To do this process, symbology is applied to the layer by referencing the .qml file. To do this, within MapPLUTO.shp, navigate to Properties > Symbology > Categorized and choose LandUse as the value.

  • Next, click Classify at bottom, and accept the random color style:

  • Next, click Load Style at bottom, and point to the stored .qml file in the lyr.style folder:

  • Note the resulting new style, and its rendering in a revised land use map that matches the ‘official’ color scheme used by NYC planning:


Further References: